<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    li {
      list-style: none;
    }

    .box {
      width: 300px;
      height: 200px;
      margin: 100px auto;
    }

    .box li {
      float: left;
      width: 24px;
      height: 24px;
      background-color: deeppink;
      margin: 15px;
      background: url(img/sprite.png) no-repeat;
    }
  </style>
</head>

<body>
  <div class="box">
    <ul>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
      <li></li>
    </ul>
  </div>
  <script>
    var lis = document.querySelectorAll('li');
    for (var i = 0; i < lis.length; i++) {
      var index = i * 44;
      lis[i].style.backgroundPosition = '0 -' + index + 'px';
    }
  </script>
</body>

</html>